<!--
 * @Description: file content
 * @Author: Wenmin He
 * @Date: 2021-07-02 17:25:17
 * @LastEditors: luojie
 * @LastEditTime: 2021-07-22 05:52:03
-->
<template>
  <view class="successful">
    <view class="img-content">
      <img class="img-box" src="https://szgd-dev.tgovcloud.com/public/images/suc.png" alt="" />
      <view class="text-content">
        <view>已完成</view>
        <view>快捷入住登记</view>
      </view>
    </view>
    <view class="button-wrapper">
      <view class="button default" @click="goHome">回到首页</view>
      <view class="button modify" @click="goBack">继续选房</view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      type: "",
      title: "",
    };
  },
  onLoad(options) {
    this.type = options.type;
    this.title = options.title;

    uni.setNavigationBarTitle({ title: options.title });
  },
  methods: {
    nextOne() {
      console.log("nextOne");
      var app = getApp();
      app.globalData.type = this.type;
      uni.switchTab({
        url: `../index/index`,
        success: (res) => {
          let page = getCurrentPages().pop();
          console.log(page)
          if (page == undefined || page == null) return;
          page.$vm.scanCode(this.type)
          // page.getOrderList();
        },
      });
    },
    goHome() {
      var app = getApp();
      app.globalData.type = "";
      uni.switchTab({
        url: `../index/index`,
      });
    },
    goBack(){
      // uni.navigateTo({
      //   url: `../rooms/index`,
      // });
       uni.$emit("reload",{data: {name: 'reload'},index: 200});
       uni.navigateBack({ delta: 2 });
    }
  },
};
</script>

<style scoped lang="scss">
.successful {
  background: #f9f9f9;
  height: 100vh;
  .img-content {
    height: 638rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    img {
      width: 178rpx;
      height: 226rpx;
    }
    .img-box {
      margin-top: 160rpx;
    }
    .text-content {
      text-align: center;
      font-size: 40rpx;
      font-weight: bold;
      line-height: 60rpx;
      color:#333;
      margin-top:56rpx;
    }
  }
  .button-wrapper {
    display: flex;
    justify-content: space-between;
    padding: 0 32rpx;
    margin-top:50rpx;
    font-size:30rpx;
  }
  .button-bottom{
    position:absolute;
    bottom:58rpx;
    width:100%;
    .button{
      width:686rpx;
      margin:0 auto;
    }
  }
  .button {
    width: 328rpx;
    height: 94rpx;
    background: #ffffff;
    border: 1rpx solid #2c9af1;
    opacity: 1;
    border-radius: 16rpx;
    text-align: center;
    line-height: 94rpx;
    &.default {
      color: #2c9af1;
    }
    &.modify{
      color:#F79672;
      border:1rpx solid #F79672;
    }
    &.primary {
      color: #fff;
      background: #2c9af1;
      border-color: #2c9af1;
    }
  }
}
</style>
